import React, { Component } from 'react';
import PropTypes from "prop-types"
import {Form,Input} from "antd"
const Item=Form.Item
class Addform extends Component {
    constructor(props) {
        super(props);
        this.state = {  }
    }
    static propTypes={
        setForm:PropTypes.func.isRequired
    }
    componentWillMount(){
        this.props.setForm(this.props.form)
    }
    render() { 
        const { getFieldDecorator } = this.props.form;
        return ( <Form>
            <Item label="角色名称">
            {getFieldDecorator('roleName', {
                initialValue:"",//初始化
            rules: [{ required: true, message: '名称必须' }],
          })(
            <Input
              placeholder="请输入角色名称"
            />,
          )}
            </Item>
        </Form> );
    }
}
 
export default Form.create()(Addform) ;